package com.qzsoft.zhjd.materiel.modules.materielbatch.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.qzsoft.zhjd.common.annotation.ZhjdDataFilter;
import com.qzsoft.zhjd.common.components.BaseServiceComponent;
import com.qzsoft.zhjd.materiel.modules.materielbatch.dto.MaterielBatchChartDto;
import com.qzsoft.zhjd.materiel.modules.materielbatch.dto.MaterielBatchCountDto;
import com.qzsoft.zhjd.materiel.modules.materielbatch.dto.MaterielBatchListDto;
import com.qzsoft.zhjd.materiel.modules.materielbatch.mapper.MaterielBatchMapper;
import com.qzsoft.zhjd.materiel.modules.materielbatch.service.MaterielBatchService;

/**
 * @ClassName MaterielBatchServiceImpl
 * @Description 过磅车次业务接口实现
 * @author linhuawei
 * @since 2022-04-02
 */
@Service
public class MaterielBatchServiceImpl implements MaterielBatchService {

    @Autowired
    private MaterielBatchMapper materielBatchMapper;

    @Autowired
    private BaseServiceComponent baseServiceComponent;

    @Override
    @ZhjdDataFilter(tableAlias = "t1")
    public MaterielBatchCountDto getCount(Map<String, Object> params) {
        return materielBatchMapper.queryCount(params);
    }

    @Override
    @ZhjdDataFilter(tableAlias = "t1")
    public List<MaterielBatchChartDto> getChart(Map<String, Object> params) {
        return materielBatchMapper.queryChart(params);
    }

    @Override
    @ZhjdDataFilter(tableAlias = "t1")
    public IPage<MaterielBatchListDto> page(Map<String, Object> params) {
        IPage<MaterielBatchListDto> page = baseServiceComponent.getPage(params, MaterielBatchListDto.class);
        return materielBatchMapper.queryDto(page, params);
    }

    @Override
    public List<MaterielBatchChartDto> getChartForHome(String baseCode, String year) {
        return materielBatchMapper.getChartForHome(baseCode, year);
    }

}
